package com.ykl.demo.comp;

import com.ykl.base.comp.EntityComp;
import com.ykl.demo.entity.SpcRoom;
import com.ykl.demo.entity.SpcStation;
import com.ykl.demo.model.RoomExportCvsModel;
import com.ykl.demo.model.RoomImportResModel;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;

import java.util.List;

public interface SpcRoomComp extends EntityComp<SpcRoom> {
    /**
     * 查询机房接口.
     * @param roomId “机房ID”等于“入参机房ID”
     * @param roomName “机房名称”等于“入参机房名称”
     * @param roomNameContains “机房名称”包含“入参机房名称”
     * @param stationNameStart “所属局站名称”以“入参所属局站名称”开始
     * @param pg 分页信息.
     * @return 查询结果.
     */
    Page<SpcRoom> querySpcRoom(String roomId, String roomName, String roomNameContains, String stationNameStart, Pageable pg);

    /**
     * 为导出查询.
     * @return 导出数据.
     */
    List<RoomExportCvsModel> query4Export();

    /**
     * 导入一条数据.
     * @param filename 文件名.
     * @param rowNo 行号.
     * @param station 所属局站.
     * @param room 导入数据.
     * @return 结果.
     */
    RoomImportResModel importRoom(String filename, int rowNo, SpcStation station, RoomImportResModel room);

    /**
     * 查询指定局站对应的所有机房.
     * @param stationId 局站.
     * @return 机房列表.
     */
    List<SpcRoom> findByStationId(String stationId);
}
